﻿using System;
using System.CodeDom.Compiler;
using System.Reflection;
using System.Runtime.CompilerServices;
using Plugin.Iconize;
using Prism.Mvvm;
using Syncfusion.ListView.XForms;
using Xamarin.Forms;
using Xamarin.Forms.Internals;
using Xamarin.Forms.Xaml;
using Xamarin.Forms.Xaml.Internals;

namespace AutoR.Views.Tasks
{
	// Token: 0x02000016 RID: 22
	[XamlFilePath("Views\\Tasks\\NodeCondition.xaml")]
	public class NodeCondition : ContentPage
	{
		// Token: 0x06000068 RID: 104 RVA: 0x0000E60A File Offset: 0x0000C80A
		public NodeCondition()
		{
			this.InitializeComponent();
		}

		// Token: 0x06000069 RID: 105 RVA: 0x0000E618 File Offset: 0x0000C818
		[GeneratedCode("Xamarin.Forms.Build.Tasks.XamlG", "0.0.0.0")]
		private void InitializeComponent()
		{
			if (ResourceLoader.ResourceProvider != null && ResourceLoader.ResourceProvider(typeof(NodeCondition).GetTypeInfo().Assembly.GetName(), "Views/Tasks/NodeCondition.xaml") != null)
			{
				this.__InitComponentRuntime();
				return;
			}
			if (XamlLoader.XamlFileProvider != null && XamlLoader.XamlFileProvider(base.GetType()) != null)
			{
				this.__InitComponentRuntime();
				return;
			}
			BindingExtension bindingExtension = new BindingExtension();
			Label label = new Label();
			BindingExtension bindingExtension2 = new BindingExtension();
			TapGestureRecognizer tapGestureRecognizer = new TapGestureRecognizer();
			Label label2 = new Label();
			StackLayout stackLayout = new StackLayout();
			BindingExtension bindingExtension3 = new BindingExtension();
			DataTemplate dataTemplate = new DataTemplate();
			SfListView sfListView = new SfListView();
			StackLayout stackLayout2 = new StackLayout();
			StackLayout stackLayout3 = new StackLayout();
			NameScope nameScope = new NameScope();
			NameScope.SetNameScope(this, nameScope);
			((INameScope)nameScope).RegisterName("List", sfListView);
			if (sfListView.StyleId == null)
			{
				sfListView.StyleId = "List";
			}
			this.List = sfListView;
			this.SetValue(ViewModelLocator.AutowireViewModelProperty, new bool?(true));
			bindingExtension.Path = "Node.Node";
			bindingExtension.StringFormat = "敌舰过滤:{0}";
			BindingBase binding = ((IMarkupExtension<BindingBase>)bindingExtension).ProvideValue(null);
			this.SetBinding(Page.TitleProperty, binding);
			stackLayout3.SetValue(View.VerticalOptionsProperty, LayoutOptions.FillAndExpand);
			stackLayout3.SetValue(View.HorizontalOptionsProperty, LayoutOptions.FillAndExpand);
			stackLayout2.SetValue(View.VerticalOptionsProperty, LayoutOptions.FillAndExpand);
			stackLayout.SetValue(StackLayout.OrientationProperty, StackOrientation.Horizontal);
			stackLayout.SetValue(View.MarginProperty, new Thickness(0.0, 0.0, 0.0, 10.0));
			label.SetValue(Label.TextProperty, "敌舰过滤");
			stackLayout.Children.Add(label);
			label2.SetValue(Label.TextProperty, "添加条件");
			label2.SetValue(Label.TextColorProperty, Color.Red);
			label2.SetValue(View.HorizontalOptionsProperty, LayoutOptions.EndAndExpand);
			bindingExtension2.Path = "AddNodeCommand";
			BindingBase binding2 = ((IMarkupExtension<BindingBase>)bindingExtension2).ProvideValue(null);
			tapGestureRecognizer.SetBinding(TapGestureRecognizer.CommandProperty, binding2);
			label2.GestureRecognizers.Add(tapGestureRecognizer);
			stackLayout.Children.Add(label2);
			stackLayout2.Children.Add(stackLayout);
			bindingExtension3.Path = "Node.NodeCondition";
			BindingBase binding3 = ((IMarkupExtension<BindingBase>)bindingExtension3).ProvideValue(null);
			sfListView.SetBinding(SfListView.ItemsSourceProperty, binding3);
			sfListView.SetValue(SfListView.AutoFitModeProperty, AutoFitMode.Height);
			sfListView.SetValue(SfListView.SelectionModeProperty, SelectionMode.None);
			sfListView.SetValue(View.VerticalOptionsProperty, LayoutOptions.FillAndExpand);
			IDataTemplate dataTemplate2 = dataTemplate;
			NodeCondition.<InitializeComponent>_anonXamlCDataTemplate_31 <InitializeComponent>_anonXamlCDataTemplate_ = new NodeCondition.<InitializeComponent>_anonXamlCDataTemplate_31();
			object[] array = new object[0 + 5];
			array[0] = dataTemplate;
			array[1] = sfListView;
			array[2] = stackLayout2;
			array[3] = stackLayout3;
			array[4] = this;
			<InitializeComponent>_anonXamlCDataTemplate_.parentValues = array;
			<InitializeComponent>_anonXamlCDataTemplate_.root = this;
			dataTemplate2.LoadTemplate = new Func<object>(<InitializeComponent>_anonXamlCDataTemplate_.LoadDataTemplate);
			sfListView.SetValue(SfListView.ItemTemplateProperty, dataTemplate);
			stackLayout2.Children.Add(sfListView);
			stackLayout3.Children.Add(stackLayout2);
			this.SetValue(ContentPage.ContentProperty, stackLayout3);
		}

		// Token: 0x0600006A RID: 106 RVA: 0x0000E95A File Offset: 0x0000CB5A
		private void __InitComponentRuntime()
		{
			this.LoadFromXaml(typeof(NodeCondition));
			this.List = this.FindByName("List");
		}

		// Token: 0x0400003E RID: 62
		[GeneratedCode("Xamarin.Forms.Build.Tasks.XamlG", "0.0.0.0")]
		private SfListView List;

		// Token: 0x02000017 RID: 23
		[CompilerGenerated]
		private sealed class <InitializeComponent>_anonXamlCDataTemplate_31
		{
			// Token: 0x0600006C RID: 108 RVA: 0x0000E994 File Offset: 0x0000CB94
			internal object LoadDataTemplate()
			{
				BindingExtension bindingExtension = new BindingExtension();
				string item = "航母";
				string item2 = "轻母";
				string item3 = "装母";
				string item4 = "战列";
				string item5 = "航战";
				string item6 = "战巡";
				string item7 = "重巡";
				string item8 = "航巡";
				string item9 = "雷巡";
				string item10 = "轻巡";
				string item11 = "重炮";
				string item12 = "驱逐";
				string item13 = "潜母";
				string item14 = "潜艇";
				string item15 = "炮潜";
				string item16 = "补给";
				string item17 = "导驱";
				string item18 = "防驱";
				Picker picker = new Picker();
				BindingExtension bindingExtension2 = new BindingExtension();
				string item19 = "＞";
				string item20 = "=";
				string item21 = "＜";
				Picker picker2 = new Picker();
				BindingExtension bindingExtension3 = new BindingExtension();
				Entry entry = new Entry();
				BindingExtension bindingExtension4 = new BindingExtension();
				string item22 = "回港";
				string item23 = "切换单纵阵";
				string item24 = "切换复纵阵";
				string item25 = "切换轮型阵";
				string item26 = "切换梯形阵";
				string item27 = "切换单横阵";
				Picker picker3 = new Picker();
				ReferenceExtension referenceExtension = new ReferenceExtension();
				BindingExtension bindingExtension5 = new BindingExtension();
				BindingExtension bindingExtension6 = new BindingExtension();
				TapGestureRecognizer tapGestureRecognizer = new TapGestureRecognizer();
				IconImage iconImage = new IconImage();
				StackLayout stackLayout = new StackLayout();
				NameScope nameScope = new NameScope();
				NameScope.SetNameScope(stackLayout, nameScope);
				stackLayout.SetValue(StackLayout.OrientationProperty, StackOrientation.Horizontal);
				bindingExtension.Path = "ShipType";
				BindingBase binding = ((IMarkupExtension<BindingBase>)bindingExtension).ProvideValue(null);
				picker.SetBinding(Picker.SelectedIndexProperty, binding);
				picker.SetValue(VisualElement.WidthRequestProperty, 80.0);
				picker.Items.Add(item);
				picker.Items.Add(item2);
				picker.Items.Add(item3);
				picker.Items.Add(item4);
				picker.Items.Add(item5);
				picker.Items.Add(item6);
				picker.Items.Add(item7);
				picker.Items.Add(item8);
				picker.Items.Add(item9);
				picker.Items.Add(item10);
				picker.Items.Add(item11);
				picker.Items.Add(item12);
				picker.Items.Add(item13);
				picker.Items.Add(item14);
				picker.Items.Add(item15);
				picker.Items.Add(item16);
				picker.Items.Add(item17);
				picker.Items.Add(item18);
				stackLayout.Children.Add(picker);
				bindingExtension2.Path = "Operator";
				BindingBase binding2 = ((IMarkupExtension<BindingBase>)bindingExtension2).ProvideValue(null);
				picker2.SetBinding(Picker.SelectedIndexProperty, binding2);
				picker2.SetValue(VisualElement.WidthRequestProperty, 40.0);
				picker2.Items.Add(item19);
				picker2.Items.Add(item20);
				picker2.Items.Add(item21);
				stackLayout.Children.Add(picker2);
				bindingExtension3.Path = "Number";
				BindingBase binding3 = ((IMarkupExtension<BindingBase>)bindingExtension3).ProvideValue(null);
				entry.SetBinding(Entry.TextProperty, binding3);
				entry.SetValue(VisualElement.WidthRequestProperty, 40.0);
				stackLayout.Children.Add(entry);
				bindingExtension4.Path = "Operating";
				BindingBase binding4 = ((IMarkupExtension<BindingBase>)bindingExtension4).ProvideValue(null);
				picker3.SetBinding(Picker.SelectedIndexProperty, binding4);
				picker3.SetValue(VisualElement.WidthRequestProperty, 100.0);
				picker3.Items.Add(item22);
				picker3.Items.Add(item23);
				picker3.Items.Add(item24);
				picker3.Items.Add(item25);
				picker3.Items.Add(item26);
				picker3.Items.Add(item27);
				stackLayout.Children.Add(picker3);
				iconImage.SetValue(IconImage.IconProperty, "md-clear");
				iconImage.SetValue(IconImage.IconColorProperty, Color.Red);
				iconImage.SetValue(VisualElement.HeightRequestProperty, 24.0);
				iconImage.SetValue(VisualElement.WidthRequestProperty, 24.0);
				iconImage.SetValue(View.HorizontalOptionsProperty, LayoutOptions.EndAndExpand);
				referenceExtension.Name = "List";
				IMarkupExtension markupExtension = referenceExtension;
				XamlServiceProvider xamlServiceProvider = new XamlServiceProvider();
				Type typeFromHandle = typeof(IProvideValueTarget);
				int length;
				object[] array = new object[(length = this.parentValues.Length) + 4];
				Array.Copy(this.parentValues, 0, array, 4, length);
				object[] array2 = array;
				array2[0] = bindingExtension5;
				array2[1] = tapGestureRecognizer;
				array2[2] = iconImage;
				array2[3] = stackLayout;
				object service;
				xamlServiceProvider.Add(typeFromHandle, service = new SimpleValueTargetProvider(array2, typeof(BindingExtension).GetRuntimeProperty("Source"), nameScope));
				xamlServiceProvider.Add(typeof(IReferenceProvider), service);
				Type typeFromHandle2 = typeof(IXamlTypeResolver);
				XmlNamespaceResolver xmlNamespaceResolver = new XmlNamespaceResolver();
				xmlNamespaceResolver.Add("", "http://xamarin.com/schemas/2014/forms");
				xmlNamespaceResolver.Add("x", "http://schemas.microsoft.com/winfx/2009/xaml");
				xmlNamespaceResolver.Add("prism", "clr-namespace:Prism.Mvvm;assembly=Prism.Forms");
				xmlNamespaceResolver.Add("syncfusion", "clr-namespace:Syncfusion.ListView.XForms;assembly=Syncfusion.SfListView.XForms");
				xmlNamespaceResolver.Add("iconize", "clr-namespace:Plugin.Iconize;assembly=Plugin.Iconize");
				xamlServiceProvider.Add(typeFromHandle2, new XamlTypeResolver(xmlNamespaceResolver, typeof(NodeCondition.<InitializeComponent>_anonXamlCDataTemplate_31).GetTypeInfo().Assembly));
				xamlServiceProvider.Add(typeof(IXmlLineInfoProvider), new XmlLineInfoProvider(new XmlLineInfo(65, 59)));
				object source = markupExtension.ProvideValue(xamlServiceProvider);
				bindingExtension5.Source = source;
				bindingExtension5.Path = "BindingContext.RemoveCommand";
				BindingBase binding5 = ((IMarkupExtension<BindingBase>)bindingExtension5).ProvideValue(null);
				tapGestureRecognizer.SetBinding(TapGestureRecognizer.CommandProperty, binding5);
				BindingBase binding6 = ((IMarkupExtension<BindingBase>)bindingExtension6).ProvideValue(null);
				tapGestureRecognizer.SetBinding(TapGestureRecognizer.CommandParameterProperty, binding6);
				iconImage.GestureRecognizers.Add(tapGestureRecognizer);
				stackLayout.Children.Add(iconImage);
				return stackLayout;
			}

			// Token: 0x0400003F RID: 63
			internal object[] parentValues;

			// Token: 0x04000040 RID: 64
			internal NodeCondition root;
		}
	}
}
